package com.itheima.task;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class NumberDemo3 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        Number number = new Number();

        FutureTask futureTask1 = new FutureTask(number);
        FutureTask futureTask2 = new FutureTask(number);

        Thread thread1 = new Thread(futureTask1);
        Thread thread2 = new Thread(futureTask2);

        thread1.start();
        thread2.start();

        futureTask1.get();
        futureTask2.get();
    }
}
